% ylx 
% 2021/6/4
% Version 0.1
% based on wwb's MainPart_wwb.m June 1st

% Global Variables are avaliable for ALL FUNCTIONS
% >>> global variables settings
global P J I ci cI r PIE 
P = [.1, .5, .9]; % for test only
J = 3; I = 8;
% end global settings <<<

% Line = xlsread('Simulated.xlsx'); 
Line = load('sim_data.mat');
patient_number = size(Line);
patient_number = patient_number(2);

S = zeros(I, J);
% Profit = zeros(patient_number, I); % For What?


for n = 1:patient_number
    j = Line(n);
    for i = 1:I
        S_test = S;
        S_test(i, j) = S_test(i, j) + 1; % Replace rim & rimS
        Q = findQ(S);
 
    end
end
    

